package com.hy.erp.inventory.pojo;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Index;
/*import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;*/

import com.hy.erp.inventory.dao.interfaces.IDepotDao;
import com.hy.erp.inventory.pojo.interfaces.ICustomer;
import com.hy.erp.inventory.pojo.interfaces.IOrganisation;
import com.hy.erp.inventory.pojo.interfaces.IPerson;
import com.hy.erp.inventory.pojo.interfaces.ISupplier;
import com.hy.erp.inventory.pojo.interfaces.IDepot;
import com.hy.mydesktop.shared.persistence.domain.gxt.MyBaseModel;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.api.annotation.DaoA;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.entity.AbstractPersistentEntity;

/**
 * 仓库
 * @author Administrator
 *
 */
@Entity
@Table(name="t_depot")
/*
@Name("depot")
@Scope(ScopeType.SESSION)
@ DaoA ( IdepotDao.class )*/
//public class depot extends AbstractPersistentEntity implements Idepot {
public class Depot extends MyBaseModel //implements IPositonType
{
	private static final long	serialVersionUID	=
														5630075647588922850L ;
	
	
	/**
	 * 构造函数
	 */
	public Depot()
	{
		super ( );
	}

	//#########################################################################################
	

	
	@Column(name="depotName",unique=false,nullable=true,insertable=true,updatable=true)
	@Index(name="depotNameIndex")
	public String getDepotname() {
		return this.get(IDepot.DEPOTNAME) ;
	}

	
	@OneToMany(targetEntity=Organisation.class,fetch=FetchType.LAZY)
	public List<IOrganisation> getOrganisation() {
		return this.get(IDepot.ORGANIZATION) ;
	}

	@Column(name="person",unique=false,nullable=true,insertable=true,updatable=true)
		public String getPerson() {
		return this.get(IDepot.PERSON) ;
	}

	@Column(name="address",unique=false,nullable=true,insertable=true,updatable=true)

	public String getAddress() {
		return this.get(IDepot.ADDRESS) ;
	}




	@OneToOne(targetEntity=DepotType.class,fetch=FetchType.LAZY)
	public DepotType getDepottype() {
		return this.get(IDepot.DEPOTTYPE) ;
	}


	/*@OneToMany(targetEntity=Supplier.class,fetch=FetchType.LAZY)
	public List<Supplier> getSupplier() {
		return this.get(IDepot.SUPPLIER) ;
	}*/


	@OneToMany(targetEntity=Customer.class,fetch=FetchType.LAZY)
	public List<ICustomer> getCustomer() {
		return this.get(IDepot.CUSTOMER) ;
	}
	

	@OneToOne(targetEntity=StockType.class,fetch=FetchType.LAZY)
	public StockType getStockType() {
		return this.get(IDepot.STOCKTYPE) ;
	}



	

	@Column(name="lossStock",unique=false,nullable=true,insertable=true,updatable=true)
	public Boolean isLossStock ( )
	{
		return this.get(IDepot.LOSSSTOCK) ;
	}

	@Column(name="becomeEffective",unique=false,nullable=true,insertable=true,updatable=true)
	public Boolean isBecomeEffective ( )
	{
		return this.get(IDepot.BECOMEFFECTIVE) ;
	}

	@Column(name="superiorDepotOrganization",unique=false,nullable=true,insertable=true,updatable=true)
	public Boolean isSuperiorDepotOrganization ( )
	{
		return this.get(IDepot.SUPERISORDEPOTORGANIZATION) ;
	}

	@Column(name="creatCargoSpace",unique=false,nullable=true,insertable=true,updatable=true)
	public Boolean isCreatCargoSpace ( )
	{
		return this.get(IDepot.CREATECARGOSPACE) ;
	}

	@Column(name="virtualDepot",unique=false,nullable=true,insertable=true,updatable=true)
	public Boolean isVirtualDepot ( )
	{
		return this.get(IDepot.VIRTUALDEPOT) ;
	}

	@Column(name="becomeEffectiveDate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getBecomeEffectiveDate ( )
	{
		return this.get(IDepot.BECOMEEFFECTIVEDATE) ;
	}

	@Column(name="failureDate",unique=false,nullable=true,insertable=true,updatable=true)
	@Temporal(TemporalType.DATE)
	public Date getFailureDate ( )
	{
		return this.get(IDepot.FAILUREDATE) ;
	}
	
	@Column(name="description",unique=false,nullable=true,insertable=true,updatable=true)
	public String getDescription ( )
	{
		return this.get(IDepot.DESCRIPTION) ;
	}

	@Column(name="remark",unique=false,nullable=true,insertable=true,updatable=true)
	public String getRemark ( )
	{
		return this.get(IDepot.REMARK) ;
	}
	
	
	//#############################################################################
	

	

	public void setDepotname(String depotname) {
		super.set (IDepot.DEPOTNAME , depotname );
	}

	public void setAddress(String address) {
		super.set (IDepot.ADDRESS , address );
	}

	public void setDepottype(DepotType depottype) {
		super.set (IDepot.DEPOTTYPE , depottype );
	}

	public void setStockType(StockType stockType) {
		super.set (IDepot.STOCKTYPE , stockType );
	}

	

	public void setOrganisation(List<Organisation> organisation) {
		super.set (IDepot.ORGANIZATION , organisation );
	}

	public void setPerson(String person) {
		super.set (IDepot.PERSON , person );
	}

	public void setSupplier(List<Supplier> supplier) {
		super.set (IDepot.SUPPLIER , supplier );
	}

	public void setCustomer(List<Customer> customer) {
		super.set (IDepot.CUSTOMER , customer );
	}

	public void setLossStock (
								Boolean lossStock )
	{
		super.set (IDepot.LOSSSTOCK , lossStock );
	}

	public void setBecomeEffective (
										Boolean becomeEffective )
	{
		super.set (IDepot.BECOMEFFECTIVE , becomeEffective );
	}

	public void setSuperiorDepotOrganization (
												Boolean superiorDepotOrganization )
	{
		super.set (IDepot.SUPERISORDEPOTORGANIZATION , superiorDepotOrganization );
	}

	public void setCreatCargoSpace (
										Boolean creatCargoSpace )
	{
		super.set (IDepot.CREATECARGOSPACE , creatCargoSpace );
	}

	public void setVirtualDepot (
									Boolean virtualDepot )
	{
		super.set (IDepot.VIRTUALDEPOT , virtualDepot );
	}

	public void setBecomeEffectiveDate (
											Date becomeEffectiveDate )
	{
		super.set (IDepot.BECOMEEFFECTIVEDATE , becomeEffectiveDate );
	}

	public void setFailureDate (
									Date failureDate )
	{
		super.set (IDepot.FAILUREDATE , failureDate );
	}

	public void setDescription (
									String description )
	{super.set (IDepot.DESCRIPTION , description );
	}

	public void setRemark (
							String remark )
	{
		super.set (IDepot.REMARK , remark );
	}
	
	/*@OneToOne(targetEntity=DefineDepotReason.class,fetch=FetchType.LAZY)
	public DefineDepotReason getDefineDepotReason() {
		return this.get(IDepot.DEFINEDEPOTREASON) ;
	}
	public void setDefineDepotReason(DefineDepotReason defineDepotReason) {
		super.set (IDepot.DEFINEDEPOTREASON , defineDepotReason );
	}*/
	
}
